cmake_minimum_required(VERSION 2.8)

#-------------------------------------------------------------------------------------------------
#------------------ include directories of ATOMISM and set source files-----------------------------
#-------------------------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake_FindModules )
FIND_PACKAGE(All4Queso REQUIRED)
   
message(STATUS "\n----------From src/Bayes/CMakeLists.txt----------")
message(STATUS "Base include directories: ${ATOMISM_BASE_INCLUDE_DIRS}")
message(STATUS "Base libraries: ${ATOMISM_BASE_LIBRARIES}")
message(STATUS "Math include directories: ${ATOMISM_MATH_INCLUDE_DIRS}")
message(STATUS "Math libraries: ${ATOMISM_MATH_LIBRARIES}")
message(STATUS "QUESO include directories: ${ALL4QUESO_INCLUDE_DIRS}")
message(STATUS "QUESO libraries: ${ALL4QUESO_LIBRARIES}")

FILE(GLOB BAYES_SRC  ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp )
FILE(GLOB BAYES_HEADER  ${CMAKE_CURRENT_SOURCE_DIR}/*.h )

INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/  
		     ${ATOMISM_BASE_INCLUDE_DIRS}/ 
		     ${ATOMISM_MATH_INCLUDE_DIRS}/
		     ${ALL4QUESO_INCLUDE_DIRS}/)

#-------------------------------------------------------------------------------------------------
#------------------ compile library base --------------------------------------------------------
#-------------------------------------------------------------------------------------------------

#add_library ( math   SHARED ${MATH_SRC}  ) 

add_library ( bayes SHARED ${BAYES_SRC}  ) 

IF( NOT COVERAGE )
   SET_TARGET_PROPERTIES( bayes PROPERTIES COMPILE_FLAGS -fPIC )
   SET_TARGET_PROPERTIES( bayes PROPERTIES COMPILE_FLAGS -O3 )
ENDIF(NOT COVERAGE )

TARGET_LINK_LIBRARIES( bayes ${ATOMISM_BASE_LIBRARIES} 
			     ${ATOMISM_MATH_LIBRARIES}
			     ${ALL4QUESO_LIBRARIES})

SET( ATOMISM_BAYES_INCLUDE_DIRS  ${CMAKE_CURRENT_SOURCE_DIR}  ${ALL4QUESO_INCLUDE_DIRS} )
SET( ATOMISM_BAYES_LIBRARIES     bayes  		      ${ALL4QUESO_LIBRARIES}    )

INSTALL(FILES  ${BAYES_HEADER} DESTINATION ${CMAKE_INSTALL_PREFIX}/include )






